<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/3/10
  Time: 19:12
  To change this template use File | Settings | File Templates.
--%>
<%--引入核心标签库--%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>list页面</title>
</head>
<body>
<h1>用户信息表</h1>
    <a href="/user/insert">新增用户</a><br>
<div>
    <h3>多条件查询用户</h3>
    <form action="/user/searchUser" method="post">
        用户id:<input type="text" name="uid" value="">
        用户名:<input type="text" name="name" value="">
        住  址:<input type="text" name="address" value="">
        <input type="submit" value="查询用户">
    </form>
</div>
    <table>
        <thead>
        <tr><th>用户ID</th>
            <th>用户名</th>
            <th>年龄</th>
            <th>性别</th>
            <th>住址</th>
            <th>薪金</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${userList}" var="user">
            <tr>
                <td>${user.uid}</td>
                <td>${user.name}</td>
                <td>${user.age}</td>
                <td>${user.sex}</td>
                <td>${user.address}</td>
                <td>${user.sal}</td>
                <td><a href="/user/delet/${user.uid}">删除</a></td>
                <td><a href="/user/update/${user.uid}">修改</a></td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
<div>
    <a href="/user/pageList?pageNum=1">首页</a>
    <c:if test="${pageInfo.hasPreviousPage}">
        <a href="/user/pageList?pageNum=${pageInfo.prePage}">上一页</a>
    </c:if>
    <c:forEach var="page"  end="${pageInfo.pages}" begin="1" step="1">
        <a href="/user/pageList?pageNum=${page}">${page}</a>
    </c:forEach>
    <c:if test="${pageInfo.hasNextPage}">
        <a href="/user/pageList?pageNum=${pageInfo.nextPage}">下一页</a>
    </c:if>
    <c:if test="${pageInfo.hasNextPage}">
        <a href="/user/pageList?pageNum=${pageInfo.pages}">尾页</a>
    </c:if>
</div>

</body>
</html>
